import dayjs from "dayjs";

const urlObj = new URL(window.location.href);
window.applicationUuid = urlObj.searchParams.get("aiUuid");
window.applicationVersion = urlObj.searchParams.get("atVeno");

window.currentWindow.maximizable = true;
window.currentWindow.fullScreenable = false;
window.currentWindow.resizable = true;
window.currentWindow.maximize();
window.currentWindow.focus();

window.formatUTCTime = (UTCTime, format = "YYYY-MM-DD HH:mm:ss") => {
    if (!UTCTime) return "";
    let localTime = new Date().UTCTimeToLocal(UTCTime);
    return dayjs(localTime).format(format);
};

window.formatTime = (time, format = "YYYY-MM-DD HH:mm:ss") => {
    if (!time) time = new Date().getTime();
    return dayjs(time).format(format);
};
